package com.wanhong.springboot.ssm.service.controller;


import com.wanhong.springboot.ssm.framework.annocation.IgnoreTokenAuth;

import com.wanhong.springboot.ssm.framework.mq.ConsumerKafka;
import com.wanhong.springboot.ssm.framework.mq.KafkaProducer;


import com.wanhong.springboot.ssm.service.entity.Location;
import com.wanhong.springboot.ssm.service.service.LocationService;
import com.wanhong.springboot.ssm.service.service.impl.LocationServiceImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author w_yu
 * @date 2020/12/7 11:51
 * @desc
 */
@RestController
public class IndexController {


    private final Logger log = LoggerFactory.getLogger(getClass());


    @Autowired
    private LocationService locationService;
    @Autowired
    private KafkaProducer kafkaProducer;
    @Autowired
    private ConsumerKafka kafkaConsumer;

    @IgnoreTokenAuth
    @RequestMapping("/demo")
    public Location demo(){

        Location location = locationService.getById(1);
        kafkaProducer.sendUserMessage(location);
//        kafkaConsumer.consume();
        return location;
    }

}
